<script setup lang="ts">
// SSE
import { ref } from 'vue';

const sse = new EventSource('http://localhost:3000/sse');
const chunkList = ref<string[]>([]);
sse.onmessage = (e) => {
    console.log(e.data);
};
sse.onerror = (e) => {
    console.log(e);
};
sse.onopen = (e) => {
    console.log(e);
};
</script>

<template>
    <div class="using">
        <div class="chunk" v-for="chunk of chunkList" :key="chunk">
            {{ chunk }}
        </div>
    </div>
</template>
